/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package model;

import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import static org.junit.Assert.*;

/**
 *
 * @author Owner
 */
public class EdgeTest {
    
    //unsure how to send Vertex<Integer> to the constructor to test methods
    
    private static model.Edge<Integer> edgeTest1;
    private model.Edge<Integer> edgeTest2;
    Vertex<Double> temp1 = new Vertex<>();
    //temp1 = (Vertex<Double>)4.4;
    Vertex<Double> temp2 = new Vertex<>();
    
    public EdgeTest() {
    }
    
    @BeforeClass
    public static void setUpClass() {
        edgeTest1 = new model.Edge<>();
    }
    
    @AfterClass
    public static void tearDownClass() {
        edgeTest1 = null;
    }
    
    @Before
    public void setUp() {
        edgeTest2 = new model.Edge(temp1, temp2, 4.4);
    }
    
    @After
    public void tearDown() {
        edgeTest2 = null;
    }

    /**
     * Test of getA method, of class Edge.
     */
    @Test
    public void testGetA() {
        System.out.println("getA");
        Vertex expResult = temp1;
        Vertex result = edgeTest2.getA();
        assertEquals(expResult, result);
    }

    /**
     * Test of getB method, of class Edge.
     */
    @Test
    public void testGetB() {
        System.out.println("getB");
        Vertex expResult = temp2;
        Vertex result = edgeTest2.getB();
        assertEquals(expResult, result);
    }

    /**
     * Test of getWeight method, of class Edge.
     */
    @Test
    public void testGetWeight() {
        System.out.println("getWeight");
        double expResult = 4.4;
        edgeTest2.setWeight(4.4);
        double result = edgeTest2.getWeight();
        assertEquals(expResult, result, 4.4);
    }

    /**
     * Test of setWeight method, of class Edge.
     */
    @Test
    public void testSetWeight() {
        System.out.println("setWeight");
        double w = 4.4;
        Edge edgeTest2 = null;
        edgeTest2.setWeight(w);
        double expResult = 4.4;
        double result = edgeTest2.getWeight();
        assertEquals(expResult, result, 4.4);
    }

    /**
     * Test of toString method, of class Edge.
     */
    @Test
    public void testToString() {
        System.out.println("toString");
        String expResult = "Test";
        String result = edgeTest2.toString();
        assertEquals(expResult, result);
    }

    /**
     * Test of getNeighbor method, of class Edge.
     */
    @Test
    public void testGetNeighbor() {
        System.out.println("getNeighbor");
        Vertex v = null;
        Edge instance = null;
        Vertex expResult = null;
        Vertex result = instance.getNeighbor(v);
        assertEquals(expResult, result);
    }

}
